
function setupSelectSkin(url) {
	$(document).ready(
		function() { 
			$("#selectTemplate").change( function() {
					$("#submit").attr("disabled","");
					$("#loading").html("loading");
					$.get(url, 
						{template: $("#selectTemplate option:selected:first").text()}, function(json) {								
								$("#loading").text("loading").show().fadeOut(1000);
								$("#selectSkin option").remove();
								var skins = eval('(' + json + ')');
								for ( var i=0; i<skins.length; i++ )
									$("#selectSkin").append("<option value="+skins[i]+">"+skins[i]+"</option>");
								$("#submit").removeAttr("disabled");								
							}
						)				
				}
			)
		});
}